package com.example.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.example.entity.User;
public interface UserDao extends JpaRepository<User,Long>{
	public User findByEmail(String email);
	
	public User findByName(String name);
	
	@Query(value="select u.id,u.name,u.email from users u where u.name=?1 and u.email<>?2",nativeQuery=true)//原生sql语句
	List<User> findUser(String name,String email);
}
